<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Hoodoo::Services::Permissions</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>
    <div class="banner">
        <h1>
            <span class="type">Class</span>
            Hoodoo::Services::Permissions
                <span class="parent">&lt;
                    Object
                </span>
        </h1>
        <ul class="files">
            <li><a href="../../../files/lib/hoodoo/data/types/permissions_rb.html">lib/hoodoo/data/types/permissions.rb</a></li>
            <li><a href="../../../files/lib/hoodoo/data/types/permissions_defaults_rb.html">lib/hoodoo/data/types/permissions_defaults.rb</a></li>
            <li><a href="../../../files/lib/hoodoo/services/middleware/middleware_rb.html">lib/hoodoo/services/middleware/middleware.rb</a></li>
            <li><a href="../../../files/lib/hoodoo/services/services/implementation_rb.html">lib/hoodoo/services/services/implementation.rb</a></li>
            <li><a href="../../../files/lib/hoodoo/services/services/permissions_rb.html">lib/hoodoo/services/services/permissions.rb</a></li>
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
    <div class="description">
      
<p>The <a href="Permissions.html">Permissions</a> class provides a way to
store and recall information on action behaviour for resources. It is just
a way to store and query this information; actually enforcing the result is
up to the caller.</p>

<p><a href="Permissions.html">Permissions</a> are based on the standard
actions - <code>list</code>, <code>show</code>, <code>create</code>,
<code>update</code> and <code>delete</code> - with defined permissions of
constants <a href="Permissions.html#DENY">DENY</a> (prohibit access), <a
href="Permissions.html#ALLOW">ALLOW</a> (allow access) and <a
href="Permissions.html#ASK">ASK</a>. The intention of <a
href="Permissions.html#ASK">ASK</a> is that some other component - usually
a service application - should be passed details of the request and asked
if it should be permitted.</p>

<p>Callers must <strong>ensure</strong> they <strong>only</strong> use the <a
href="Permissions.html#DENY">DENY</a>, <a
href="Permissions.html#ALLOW">ALLOW</a> and <a
href="Permissions.html#ASK">ASK</a> constants defined herein, without
making assumptions about their assigned values.</p>

<p>There is both a default set of permissions in addition to per-resource
permissions and there is a fallback for cases where a permission for a
particular action has not been defined. This lets you define the baseline
behaviour in the fallback cases and only describe exceptions to that
baseline through the <a href="Permissions.html">Permissions</a> interface,
minimising caller workload.</p>

<p><a href="Middleware.html">Hoodoo::Services::Middleware</a> uses an instance
of this class to determine whether or not it should pass on inbound
requests to service applications.</p>

<p>Example:</p>

<p>Here, an object is created with a default fallback of <a
href="Permissions.html#DENY">DENY</a>, then has the action “list” allowed
for all resources and says that resource “Member” must ask someone for
permission if its “show” action is requested. Another resource “Ping”
allows any action unconditionally.</p>

<pre><code>p = Hoodoo::Services::Permissions.new
p.set_default( :list, Hoodoo::Services::Permissions::ALLOW )
p.set_resource( :Member, :show, Hoodoo::Services::Permissions::ASK )
p.set_resource_fallback( :Ping, Hoodoo::Services::Permissions::ALLOW )

puts JSON.pretty_generate( p.to_h() )

# Yields...
#
# {
#   &quot;default&quot;: {
#     &quot;else&quot;: &quot;deny&quot;,
#     &quot;actions&quot;: {
#       &quot;list&quot;: &quot;allow&quot;
#     }
#   },
#   &quot;resources&quot;: {
#     &quot;Member&quot;: {
#       &quot;actions&quot;: {
#         &quot;show&quot;: &quot;ask&quot;
#       }
#     },
#     &quot;Ping&quot;: {
#       &quot;else&quot;: &quot;allow&quot;
#     }
#   }
# }
</code></pre>

    </div>








    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
        <dt>F</dt>
        <dd>
          <ul>
              <li>
                <a href="#method-i-from_h-21">from_h!</a>
              </li>
          </ul>
        </dd>
        <dt>M</dt>
        <dd>
          <ul>
              <li>
                <a href="#method-i-merge-21">merge!</a>
              </li>
          </ul>
        </dd>
        <dt>N</dt>
        <dd>
          <ul>
              <li>
                <a href="#method-c-new">new</a>
              </li>
          </ul>
        </dd>
        <dt>P</dt>
        <dd>
          <ul>
              <li>
                <a href="#method-i-permitted-3F">permitted?</a>
              </li>
          </ul>
        </dd>
        <dt>S</dt>
        <dd>
          <ul>
              <li>
                <a href="#method-i-set_default">set_default</a>,
              </li>
              <li>
                <a href="#method-i-set_default_fallback">set_default_fallback</a>,
              </li>
              <li>
                <a href="#method-i-set_resource">set_resource</a>,
              </li>
              <li>
                <a href="#method-i-set_resource_fallback">set_resource_fallback</a>
              </li>
          </ul>
        </dd>
        <dt>T</dt>
        <dd>
          <ul>
              <li>
                <a href="#method-i-to_h">to_h</a>
              </li>
          </ul>
        </dd>
    </dl>










    <!-- Methods -->
      <div class="sectiontitle">Class Public methods</div>
        <div class="method">
          <div class="title method-title" id="method-c-new">
              <b>new</b>( hash = nil )
            <a href="../../../classes/Hoodoo/Services/Permissions.html#method-c-new" name="method-c-new" class="permalink">Link</a>
          </div>

            <div class="description">
              <p>Create a new <a href="Permissions.html">Permissions</a> instance,
optionally from a Hash of the format returned by <a
href="Permissions.html#method-i-to_h">to_h</a>.</p>

<p>By default the object is initialised with a default fallback which denies
all actions for all resources.</p>
            </div>



            <div class="sourcecode">
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
              </p>
              <div id="method-c-new_source" class="dyn-source">
                <pre><span class="ruby-comment"># File lib/hoodoo/services/services/permissions.rb, line 98</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">initialize</span>( <span class="ruby-identifier">hash</span> = <span class="ruby-keyword">nil</span> )
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-ivar">@permissions</span> = {}
    <span class="ruby-identifier">set_default_fallback</span>( <span class="ruby-constant">DENY</span> )
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">from_h!</span>( <span class="ruby-identifier">hash</span> )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
          </div>
      <div class="sectiontitle">Instance Public methods</div>
        <div class="method">
          <div class="title method-title" id="method-i-from_h-21">
              <b>from_h!</b>( hash )
            <a href="../../../classes/Hoodoo/Services/Permissions.html#method-i-from_h-21" name="method-i-from_h-21" class="permalink">Link</a>
          </div>

            <div class="description">
              <p>Overwrite this instances&#39;s permissions with those from the given Hash.</p>
<dl class="rdoc-list note-list"><dt>hash
<dd>
<p><a href="Permissions.html">Permissions</a> hash, which must come (directly
or indirectly) from a <a href="Permissions.html#method-i-to_h">to_h</a>
call.</p>
</dd></dl>
            </div>



            <div class="sourcecode">
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-from_h-21_source')" id="l_method-i-from_h-21_source">show</a>
              </p>
              <div id="method-i-from_h-21_source" class="dyn-source">
                <pre><span class="ruby-comment"># File lib/hoodoo/services/services/permissions.rb, line 214</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">from_h!</span>( <span class="ruby-identifier">hash</span> )
  <span class="ruby-ivar">@permissions</span> = <span class="ruby-constant">Hoodoo</span><span class="ruby-operator">::</span><span class="ruby-constant">Utilities</span>.<span class="ruby-identifier">stringify</span>( <span class="ruby-identifier">hash</span> )
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
          </div>
        <div class="method">
          <div class="title method-title" id="method-i-merge-21">
              <b>merge!</b>( hash )
            <a href="../../../classes/Hoodoo/Services/Permissions.html#method-i-merge-21" name="method-i-merge-21" class="permalink">Link</a>
          </div>

            <div class="description">
              <p>Merge the permissions described by the given Hash with those inside this
instance. This will add to, or overwrite permissions with those from the
given input Hash.</p>
<dl class="rdoc-list note-list"><dt><code>hash</code>
<dd>
<p><a href="Permissions.html">Permissions</a> hash, which must come (directly
or indirectly) from a <a href="Permissions.html#method-i-to_h">to_h</a>
call.</p>
</dd></dl>
            </div>



            <div class="sourcecode">
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-merge-21_source')" id="l_method-i-merge-21_source">show</a>
              </p>
              <div id="method-i-merge-21_source" class="dyn-source">
                <pre><span class="ruby-comment"># File lib/hoodoo/services/services/permissions.rb, line 225</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">merge!</span>( <span class="ruby-identifier">hash</span> )
  <span class="ruby-ivar">@permissions</span> = <span class="ruby-constant">Hoodoo</span><span class="ruby-operator">::</span><span class="ruby-constant">Utilities</span>.<span class="ruby-identifier">deep_merge_into</span>(
    <span class="ruby-ivar">@permissions</span>,
    <span class="ruby-constant">Hoodoo</span><span class="ruby-operator">::</span><span class="ruby-constant">Utilities</span>.<span class="ruby-identifier">stringify</span>( <span class="ruby-identifier">hash</span> )
  )
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
          </div>
        <div class="method">
          <div class="title method-title" id="method-i-permitted-3F">
              <b>permitted?</b>( resource_name, action_name )
            <a href="../../../classes/Hoodoo/Services/Permissions.html#method-i-permitted-3F" name="method-i-permitted-3F" class="permalink">Link</a>
          </div>

            <div class="description">
              <p>For the given resource, is the given action permitted? Returns one of the
<a href="Permissions.html#ALLOW">ALLOW</a>, <a
href="Permissions.html#DENY">DENY</a> or <a
href="Permissions.html#ASK">ASK</a> constant values.</p>
<dl class="rdoc-list note-list"><dt><code>resource_name</code>
<dd>
<p>Resource name as a Symbol or String, e.g. “<code>Purchase</code>” or
<code>:Member</code>.</p>
</dd><dt><code>action_name</code>
<dd>
<p>Action as a String or Symbol, from: <code>list</code>, <code>show</code>,
<code>create</code>, <code>update</code> or <code>delete</code>.</p>
</dd></dl>
            </div>



            <div class="sourcecode">
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-permitted-3F_source')" id="l_method-i-permitted-3F_source">show</a>
              </p>
              <div id="method-i-permitted-3F_source" class="dyn-source">
                <pre><span class="ruby-comment"># File lib/hoodoo/services/services/permissions.rb, line 183</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">permitted?</span>( <span class="ruby-identifier">resource_name</span>, <span class="ruby-identifier">action_name</span> )
  <span class="ruby-identifier">resource_name</span> = <span class="ruby-identifier">resource_name</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-identifier">action_name</span>   = <span class="ruby-identifier">action_name</span>.<span class="ruby-identifier">to_s</span>

  <span class="ruby-identifier">tree</span> = <span class="ruby-keyword">if</span> <span class="ruby-ivar">@permissions</span>.<span class="ruby-identifier">has_key?</span>( <span class="ruby-string">&#39;resources&#39;</span> )
    <span class="ruby-ivar">@permissions</span>[ <span class="ruby-string">&#39;resources&#39;</span> ][ <span class="ruby-identifier">resource_name</span> ]
  <span class="ruby-keyword">end</span> <span class="ruby-operator">||</span> {}

  <span class="ruby-identifier">result</span> = <span class="ruby-identifier">permitted_in?</span>( <span class="ruby-identifier">tree</span>, <span class="ruby-identifier">action_name</span> )

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-identifier">tree</span> = <span class="ruby-ivar">@permissions</span>[ <span class="ruby-string">&#39;default&#39;</span> ] <span class="ruby-operator">||</span> {}
    <span class="ruby-identifier">result</span> = <span class="ruby-identifier">permitted_in?</span>( <span class="ruby-identifier">tree</span>, <span class="ruby-identifier">action_name</span> )
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">||</span> <span class="ruby-constant">DENY</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
          </div>
        <div class="method">
          <div class="title method-title" id="method-i-set_default">
              <b>set_default</b>( action_name, permission )
            <a href="../../../classes/Hoodoo/Services/Permissions.html#method-i-set_default" name="method-i-set_default" class="permalink">Link</a>
          </div>

            <div class="description">
              <p>Set the default permission for the given action. If a resource does not
have a specific entry for it in the <a
href="Permissions.html">Permissions</a> object but the action matches the
given name, then this permission is used.</p>
<dl class="rdoc-list note-list"><dt><code>action_name</code>
<dd>
<p>Action as a String or Symbol, from: <code>list</code>, <code>show</code>,
<code>create</code>, <code>update</code> or <code>delete</code>.</p>
</dd><dt><code>permission</code>
<dd>
<p><a href="Permissions.html#DENY">DENY</a>, <a
href="Permissions.html#ALLOW">ALLOW</a> or <a
href="Permissions.html#ASK">ASK</a>.</p>
</dd></dl>
            </div>



            <div class="sourcecode">
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-set_default_source')" id="l_method-i-set_default_source">show</a>
              </p>
              <div id="method-i-set_default_source" class="dyn-source">
                <pre><span class="ruby-comment"># File lib/hoodoo/services/services/permissions.rb, line 129</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">set_default</span>( <span class="ruby-identifier">action_name</span>, <span class="ruby-identifier">permission</span> )
  <span class="ruby-identifier">action_name</span> = <span class="ruby-identifier">action_name</span>.<span class="ruby-identifier">to_s</span>

  <span class="ruby-ivar">@permissions</span>[ <span class="ruby-string">&#39;default&#39;</span> ] <span class="ruby-operator">||=</span> {}
  <span class="ruby-ivar">@permissions</span>[ <span class="ruby-string">&#39;default&#39;</span> ][ <span class="ruby-string">&#39;actions&#39;</span> ] <span class="ruby-operator">||=</span> {}
  <span class="ruby-ivar">@permissions</span>[ <span class="ruby-string">&#39;default&#39;</span> ][ <span class="ruby-string">&#39;actions&#39;</span> ][ <span class="ruby-identifier">action_name</span> ] = <span class="ruby-identifier">permission</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
          </div>
        <div class="method">
          <div class="title method-title" id="method-i-set_default_fallback">
              <b>set_default_fallback</b>( permission )
            <a href="../../../classes/Hoodoo/Services/Permissions.html#method-i-set_default_fallback" name="method-i-set_default_fallback" class="permalink">Link</a>
          </div>

            <div class="description">
              <p>Set the default fallback for actions. If a resource does not have a
specific entry for it in the <a href="Permissions.html">Permissions</a>
object and if the action does not have a default permission, then this
permission used.</p>
<dl class="rdoc-list note-list"><dt><code>permission</code>
<dd>
<p><a href="Permissions.html#DENY">DENY</a>, <a
href="Permissions.html#ALLOW">ALLOW</a> or <a
href="Permissions.html#ASK">ASK</a>.</p>
</dd></dl>
            </div>



            <div class="sourcecode">
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-set_default_fallback_source')" id="l_method-i-set_default_fallback_source">show</a>
              </p>
              <div id="method-i-set_default_fallback_source" class="dyn-source">
                <pre><span class="ruby-comment"># File lib/hoodoo/services/services/permissions.rb, line 113</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">set_default_fallback</span>( <span class="ruby-identifier">permission</span> )
  <span class="ruby-identifier">action_name</span> = <span class="ruby-identifier">action_name</span>.<span class="ruby-identifier">to_s</span>

  <span class="ruby-ivar">@permissions</span>[ <span class="ruby-string">&#39;default&#39;</span> ] <span class="ruby-operator">||=</span> {}
  <span class="ruby-ivar">@permissions</span>[ <span class="ruby-string">&#39;default&#39;</span> ][ <span class="ruby-string">&#39;else&#39;</span> ] = <span class="ruby-identifier">permission</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
          </div>
        <div class="method">
          <div class="title method-title" id="method-i-set_resource">
              <b>set_resource</b>( resource_name, action_name, permission )
            <a href="../../../classes/Hoodoo/Services/Permissions.html#method-i-set_resource" name="method-i-set_resource" class="permalink">Link</a>
          </div>

            <div class="description">
              <p>Set the permissions an action on a resource.</p>
<dl class="rdoc-list note-list"><dt>resource_name
<dd>
<p>Resource name as a Symbol or String, e.g. “<code>Purchase</code>” or
<code>:Member</code>.</p>
</dd><dt><code>action_name</code>
<dd>
<p>Action as a String or Symbol, from: <code>list</code>, <code>show</code>,
<code>create</code>, <code>update</code> or <code>delete</code>.</p>
</dd><dt><code>permission</code>
<dd>
<p><a href="Permissions.html#DENY">DENY</a>, <a
href="Permissions.html#ALLOW">ALLOW</a> or <a
href="Permissions.html#ASK">ASK</a>.</p>
</dd></dl>
            </div>



            <div class="sourcecode">
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-set_resource_source')" id="l_method-i-set_resource_source">show</a>
              </p>
              <div id="method-i-set_resource_source" class="dyn-source">
                <pre><span class="ruby-comment"># File lib/hoodoo/services/services/permissions.rb, line 164</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">set_resource</span>( <span class="ruby-identifier">resource_name</span>, <span class="ruby-identifier">action_name</span>, <span class="ruby-identifier">permission</span> )
  <span class="ruby-identifier">resource_name</span> = <span class="ruby-identifier">resource_name</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-identifier">action_name</span>   = <span class="ruby-identifier">action_name</span>.<span class="ruby-identifier">to_s</span>

  <span class="ruby-ivar">@permissions</span>[ <span class="ruby-string">&#39;resources&#39;</span> ] <span class="ruby-operator">||=</span> {}
  <span class="ruby-ivar">@permissions</span>[ <span class="ruby-string">&#39;resources&#39;</span> ][ <span class="ruby-identifier">resource_name</span> ] <span class="ruby-operator">||=</span> {}
  <span class="ruby-ivar">@permissions</span>[ <span class="ruby-string">&#39;resources&#39;</span> ][ <span class="ruby-identifier">resource_name</span> ][ <span class="ruby-string">&#39;actions&#39;</span> ] <span class="ruby-operator">||=</span> {}
  <span class="ruby-ivar">@permissions</span>[ <span class="ruby-string">&#39;resources&#39;</span> ][ <span class="ruby-identifier">resource_name</span> ][ <span class="ruby-string">&#39;actions&#39;</span> ][ <span class="ruby-identifier">action_name</span> ] = <span class="ruby-identifier">permission</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
          </div>
        <div class="method">
          <div class="title method-title" id="method-i-set_resource_fallback">
              <b>set_resource_fallback</b>( resource_name, permission )
            <a href="../../../classes/Hoodoo/Services/Permissions.html#method-i-set_resource_fallback" name="method-i-set_resource_fallback" class="permalink">Link</a>
          </div>

            <div class="description">
              <p>Set the default fallback for a resource. If the resource is asked to
perform an action that&#39;s not otherwise listed in the resource&#39;s
entry in the <a href="Permissions.html">Permissions</a> object, then this
permission is used.</p>
<dl class="rdoc-list note-list"><dt><code>resource_name</code>
<dd>
<p>Resource name as a Symbol or String, e.g. “<code>Purchase</code>” or
<code>:Member</code>.</p>
</dd><dt><code>permission</code>
<dd>
<p><a href="Permissions.html#DENY">DENY</a>, <a
href="Permissions.html#ALLOW">ALLOW</a> or <a
href="Permissions.html#ASK">ASK</a>.</p>
</dd></dl>
            </div>



            <div class="sourcecode">
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-set_resource_fallback_source')" id="l_method-i-set_resource_fallback_source">show</a>
              </p>
              <div id="method-i-set_resource_fallback_source" class="dyn-source">
                <pre><span class="ruby-comment"># File lib/hoodoo/services/services/permissions.rb, line 146</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">set_resource_fallback</span>( <span class="ruby-identifier">resource_name</span>, <span class="ruby-identifier">permission</span> )
  <span class="ruby-identifier">resource_name</span> = <span class="ruby-identifier">resource_name</span>.<span class="ruby-identifier">to_s</span>

  <span class="ruby-ivar">@permissions</span>[ <span class="ruby-string">&#39;resources&#39;</span> ] <span class="ruby-operator">||=</span> {}
  <span class="ruby-ivar">@permissions</span>[ <span class="ruby-string">&#39;resources&#39;</span> ][ <span class="ruby-identifier">resource_name</span> ] <span class="ruby-operator">||=</span> {}
  <span class="ruby-ivar">@permissions</span>[ <span class="ruby-string">&#39;resources&#39;</span> ][ <span class="ruby-identifier">resource_name</span> ][ <span class="ruby-string">&#39;else&#39;</span> ] = <span class="ruby-identifier">permission</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
          </div>
        <div class="method">
          <div class="title method-title" id="method-i-to_h">
              <b>to_h</b>()
            <a href="../../../classes/Hoodoo/Services/Permissions.html#method-i-to_h" name="method-i-to_h" class="permalink">Link</a>
          </div>

            <div class="description">
              <p>Return a Hash representative of this permissions object, which can be
stored elsewhere, used to initialise another instance or written to an
existing instance with <a
href="Permissions.html#method-i-from_h-21">from_h!</a>.</p>
            </div>



            <div class="sourcecode">
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-to_h_source')" id="l_method-i-to_h_source">show</a>
              </p>
              <div id="method-i-to_h_source" class="dyn-source">
                <pre><span class="ruby-comment"># File lib/hoodoo/services/services/permissions.rb, line 205</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">to_h</span>
  <span class="ruby-ivar">@permissions</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
          </div>
</div>

    </div>
  </body>
</html>
